home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: Mailbox/MIME Entity
(archive/mbox).
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| Newsgroup Content (archive/news)
| magic
| Supported |
100%
| dexvert
| Mailbox/MIME Entity (archive/mbox)
| magic
| Supported |
100%
| dexvert
| Internet Message Format (text/imf)
| magic
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| news, ASCII text
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| dexmagic
| PrintFox/Pagefox WEAK
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| fmt/950 MIME Email (1.0)
| default
| |
100%
| detectItEasy
| Format: plain text[LF]
| default (weak)
| |
100%
| xdgMime
| message/news
| default
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 50 61 74 68 3a 20 6e 65 | 77 73 2e 6f 6e 72 61 6d |Path: ne|ws.onram|
|00000010| 70 2e 6e 65 74 21 75 73 | 65 6e 65 74 0a 46 72 6f |p.net!us|enet.Fro|
|00000020| 6d 3a 20 4c 65 65 20 4d | 65 61 64 6f 72 20 3c 72 |m: Lee M|eador <r|
|00000030| 74 62 73 40 6f 6e 72 61 | 6d 70 2e 6e 65 74 3e 0a |tbs@onra|mp.net>.|
|00000040| 4e 65 77 73 67 72 6f 75 | 70 73 3a 20 63 6f 6d 70 |Newsgrou|ps: comp|
|00000050| 2e 6c 61 6e 67 2e 63 0a | 53 75 62 6a 65 63 74 3a |.lang.c.|Subject:|
|00000060| 20 52 65 3a 20 48 65 6c | 70 20 42 54 72 65 65 20 | Re: Hel|p BTree |
|00000070| 44 65 6c 65 74 65 0a 44 | 61 74 65 3a 20 57 65 64 |Delete.D|ate: Wed|
|00000080| 2c 20 32 37 20 4d 61 72 | 20 31 39 39 36 20 30 39 |, 27 Mar| 1996 09|
|00000090| 3a 35 33 3a 33 38 20 2d | 30 38 30 30 0a 4f 72 67 |:53:38 -|0800.Org|
|000000a0| 61 6e 69 7a 61 74 69 6f | 6e 3a 20 52 65 61 6c 54 |anizatio|n: RealT|
|000000b0| 69 6d 65 0a 4d 65 73 73 | 61 67 65 2d 49 44 3a 20 |ime.Mess|age-ID: |
|000000c0| 3c 33 31 35 39 38 30 41 | 32 2e 32 44 38 46 40 6f |<315980A|2.2D8F@o|
|000000d0| 6e 72 61 6d 70 2e 6e 65 | 74 3e 0a 52 65 66 65 72 |nramp.ne|t>.Refer|
|000000e0| 65 6e 63 65 73 3a 20 3c | 34 6a 62 62 35 71 24 72 |ences: <|4jbb5q$r|
|000000f0| 70 6f 40 6e 65 77 73 2d | 65 32 63 2e 67 6e 6e 2e |po@news-|e2c.gnn.|
|00000100| 63 6f 6d 3e 0a 4e 4e 54 | 50 2d 50 6f 73 74 69 6e |com>.NNT|P-Postin|
|00000110| 67 2d 48 6f 73 74 3a 20 | 73 74 65 6d 6d 6f 6e 73 |g-Host: |stemmons|
|00000120| 33 31 2e 6f 6e 72 61 6d | 70 2e 6e 65 74 0a 4d 69 |31.onram|p.net.Mi|
|00000130| 6d 65 2d 56 65 72 73 69 | 6f 6e 3a 20 31 2e 30 0a |me-Versi|on: 1.0.|
|00000140| 43 6f 6e 74 65 6e 74 2d | 54 79 70 65 3a 20 74 65 |Content-|Type: te|
|00000150| 78 74 2f 70 6c 61 69 6e | 3b 20 63 68 61 72 73 65 |xt/plain|; charse|
|00000160| 74 3d 75 73 2d 61 73 63 | 69 69 0a 43 6f 6e 74 65 |t=us-asc|ii.Conte|
|00000170| 6e 74 2d 54 72 61 6e 73 | 66 65 72 2d 45 6e 63 6f |nt-Trans|fer-Enco|
|00000180| 64 69 6e 67 3a 20 37 62 | 69 74 0a 58 2d 4d 61 69 |ding: 7b|it.X-Mai|
|00000190| 6c 65 72 3a 20 4d 6f 7a | 69 6c 6c 61 20 32 2e 30 |ler: Moz|illa 2.0|
|000001a0| 20 28 57 69 6e 31 36 3b | 20 49 29 0a 54 6f 3a 20 | (Win16;| I).To: |
|000001b0| 4a 6f 68 6e 20 42 72 69 | 6e 67 6f 6c 66 20 3c 4a |John Bri|ngolf <J|
|000001c0| 42 72 69 6e 67 6f 6c 66 | 40 67 6e 6e 2e 63 6f 6d |Bringolf|@gnn.com|
|000001d0| 3e 0a 0a 4a 6f 68 6e 20 | 42 72 69 6e 67 6f 6c 66 |>..John |Bringolf|
|000001e0| 20 77 72 6f 74 65 3a 0a | 3e 20 0a 3e 20 44 6f 65 | wrote:.|> .> Doe|
|000001f0| 73 20 61 6e 79 6f 6e 65 | 20 68 61 76 65 20 65 78 |s anyone| have ex|
|00000200| 61 6d 70 6c 65 73 20 6f | 66 20 61 20 64 65 6c 65 |amples o|f a dele|
|00000210| 74 65 20 66 75 6e 63 74 | 69 6f 6e 20 66 6f 72 20 |te funct|ion for |
|00000220| 62 69 6e 61 72 79 20 74 | 72 65 65 73 3f 0a 3e 20 |binary t|rees?.> |
|00000230| 0a 3e 20 73 74 72 75 63 | 74 20 52 65 63 7b 0a 3e |.> struc|t Rec{.>|
|00000240| 20 20 20 63 68 61 72 20 | 44 61 74 61 5b 33 30 5d | char |Data[30]|
|00000250| 3b 0a 3e 20 20 20 73 74 | 72 75 63 74 20 52 65 63 |;.> st|ruct Rec|
|00000260| 20 2a 4c 65 66 74 3b 0a | 3e 20 20 20 73 74 72 75 | *Left;.|> stru|
|00000270| 63 74 20 52 65 63 20 2a | 52 69 67 68 74 3b 0a 3e |ct Rec *|Right;.>|
|00000280| 20 20 20 7d 20 4d 79 52 | 65 63 3b 0a 3e 20 0a 3e | } MyR|ec;.> .>|
|00000290| 20 49 73 20 69 73 20 62 | 65 73 74 20 74 6f 2e 2e | Is is b|est to..|
|000002a0| 2e 0a 3e 20 0a 3e 20 50 | 61 73 73 20 54 72 65 65 |..> .> P|ass Tree|
|000002b0| 20 61 6e 64 20 49 74 65 | 6d 0a 3e 20 20 20 20 28 | and Ite|m.> (|
|000002c0| 45 78 3a 20 76 6f 69 64 | 20 44 65 6c 65 74 65 28 |Ex: void| Delete(|
|000002d0| 73 74 72 75 63 74 20 52 | 65 63 20 2a 4d 79 52 65 |struct R|ec *MyRe|
|000002e0| 63 2c 20 63 68 61 72 20 | 44 61 74 61 54 6f 44 65 |c, char |DataToDe|
|000002f0| 6c 65 74 65 5b 33 30 5d | 29 20 29 0a 3e 20 2d 6f |lete[30]|) ).> -o|
|00000300| 72 2d 0a 3e 20 0a 3e 20 | 55 73 65 20 61 20 66 69 |r-.> .> |Use a fi|
|00000310| 6e 64 2f 73 65 61 72 63 | 68 20 61 6e 64 20 70 61 |nd/searc|h and pa|
|00000320| 73 73 20 61 20 70 6f 69 | 6e 74 65 72 20 74 6f 74 |ss a poi|nter tot|
|00000330| 20 68 65 20 64 65 6c 65 | 74 65 20 3f 3f 3f 0a 3e | he dele|te ???.>|
|00000340| 20 0a 3e 20 54 68 61 6e | 6b 73 20 4a 42 0a 3e 20 | .> Than|ks JB.> |
|00000350| 4a 6f 68 6e 20 42 72 69 | 6e 67 6f 6c 66 20 4a 42 |John Bri|ngolf JB|
|00000360| 72 69 6e 67 6f 6c 66 40 | 67 6e 6e 2e 63 6f 6d 0a |ringolf@|gnn.com.|
|00000370| 0a 49 20 6c 69 6b 65 20 | 74 68 65 20 6c 61 74 65 |.I like |the late|
|00000380| 72 20 6d 65 74 68 6f 64 | 20 69 6e 20 67 65 6e 65 |r method| in gene|
|00000390| 72 61 6c 2e 20 49 20 74 | 68 69 6e 6b 20 69 74 20 |ral. I t|hink it |
|000003a0| 6c 65 6e 64 73 20 69 74 | 73 65 6c 66 20 74 6f 20 |lends it|self to |
|000003b0| 0a 72 65 75 73 61 62 69 | 6c 69 74 79 20 62 75 74 |.reusabi|lity but|
|000003c0| 20 79 6f 75 20 64 6f 20 | 6e 65 65 64 20 74 6f 20 | you do |need to |
|000003d0| 70 61 73 73 20 74 68 65 | 20 70 61 72 65 6e 74 20 |pass the| parent |
|000003e0| 6f 66 20 74 68 65 20 6e | 6f 64 65 20 79 6f 75 20 |of the n|ode you |
|000003f0| 61 72 65 20 0a 64 65 6c | 65 74 69 6e 67 20 61 6e |are .del|eting an|
|00000400| 64 20 61 20 66 6c 61 67 | 20 61 73 20 74 6f 20 77 |d a flag| as to w|
|00000410| 68 65 74 68 65 72 20 79 | 6f 75 20 61 72 65 20 64 |hether y|ou are d|
|00000420| 65 6c 65 74 69 6e 67 20 | 74 68 65 20 6c 65 66 74 |eleting |the left|
|00000430| 20 6f 72 20 72 69 67 68 | 74 20 0a 63 68 69 6c 64 | or righ|t .child|
|00000440| 2e 20 49 66 20 79 6f 75 | 20 64 6f 20 74 68 69 73 |. If you| do this|
|00000450| 2c 20 74 68 65 6e 20 74 | 68 65 20 73 65 61 72 63 |, then t|he searc|
|00000460| 68 20 72 6f 75 74 69 6e | 65 20 62 65 63 6f 6d 65 |h routin|e become|
|00000470| 20 74 6f 74 61 6c 6c 79 | 20 6d 61 6c 66 6f 72 6d | totally| malform|
|00000480| 65 64 20 0a 73 69 6e 63 | 65 20 69 74 20 6d 75 73 |ed .sinc|e it mus|
|00000490| 74 20 72 65 74 75 72 6e | 20 74 68 65 20 70 61 72 |t return| the par|
|000004a0| 65 6e 74 20 6f 66 20 74 | 68 65 20 6e 6f 64 65 20 |ent of t|he node |
|000004b0| 69 74 20 6d 61 74 63 68 | 65 73 2e 20 4e 4f 54 45 |it match|es. NOTE|
|000004c0| 3a 20 59 6f 75 20 6e 65 | 65 64 20 0a 74 68 65 20 |: You ne|ed .the |
|000004d0| 70 61 72 65 6e 74 20 73 | 6f 20 79 6f 75 20 63 61 |parent s|o you ca|
|000004e0| 6e 20 68 6f 6f 6b 20 74 | 68 65 20 6e 65 77 20 73 |n hook t|he new s|
|000004f0| 75 62 74 72 65 65 20 62 | 61 63 6b 20 69 6e 20 77 |ubtree b|ack in w|
|00000500| 68 65 72 65 20 74 68 65 | 20 64 65 6c 65 74 65 64 |here the| deleted|
|00000510| 20 6e 6f 64 65 20 0a 77 | 61 73 2e 0a 0a 4f 74 68 | node .w|as...Oth|
|00000520| 65 72 20 70 72 6f 62 6c | 65 6d 73 20 74 6f 20 73 |er probl|ems to s|
|00000530| 6f 6c 76 65 2e 20 57 68 | 61 74 20 69 66 20 74 68 |olve. Wh|at if th|
|00000540| 65 20 6e 6f 64 65 20 79 | 6f 75 20 61 72 65 20 64 |e node y|ou are d|
|00000550| 65 6c 65 74 69 6e 67 20 | 69 73 20 74 68 65 20 72 |eleting |is the r|
|00000560| 6f 6f 74 20 0a 6e 6f 64 | 65 20 6f 66 20 74 68 65 |oot .nod|e of the|
|00000570| 20 74 72 65 65 3f 20 48 | 6f 77 20 64 6f 20 79 6f | tree? H|ow do yo|
|00000580| 75 20 68 6f 6f 6b 20 74 | 68 65 20 6e 65 77 20 73 |u hook t|he new s|
|00000590| 75 62 74 72 65 65 20 69 | 6e 3f 20 59 6f 75 20 68 |ubtree i|n? You h|
|000005a0| 61 76 65 20 74 6f 20 6b | 6e 6f 77 20 0a 68 6f 77 |ave to k|now .how|
|000005b0| 20 74 68 65 20 72 6f 6f | 74 20 69 73 20 73 74 6f | the roo|t is sto|
|000005c0| 72 65 64 2e 0a 0a 48 6f | 77 20 61 72 65 20 79 6f |red...Ho|w are yo|
|000005d0| 75 20 70 6c 61 6e 6e 69 | 6e 67 20 6f 6e 20 6d 65 |u planni|ng on me|
|000005e0| 72 67 69 6e 67 20 74 68 | 65 20 74 77 6f 20 73 75 |rging th|e two su|
|000005f0| 62 74 72 65 65 73 20 69 | 6e 74 6f 20 61 20 73 69 |btrees i|nto a si|
|00000600| 6e 67 6c 65 20 74 72 65 | 65 20 74 68 61 74 20 0a |ngle tre|e that .|
|00000610| 63 61 6e 20 62 65 20 68 | 6f 6f 6b 65 64 20 62 61 |can be h|ooked ba|
|00000620| 63 6b 20 69 6e 20 77 68 | 65 72 65 20 74 68 65 20 |ck in wh|ere the |
|00000630| 64 65 6c 65 74 65 20 6e | 6f 64 65 20 77 61 73 3f |delete n|ode was?|
|00000640| 20 44 6f 20 79 6f 75 20 | 72 65 71 75 69 72 65 20 | Do you |require |
|00000650| 0a 62 61 6c 61 6e 63 69 | 6e 67 20 6f 66 20 74 68 |.balanci|ng of th|
|00000660| 65 20 6e 65 77 20 73 75 | 62 74 72 65 65 3f 20 59 |e new su|btree? Y|
|00000670| 6f 75 20 63 6f 75 6c 64 | 20 6a 75 73 74 20 68 75 |ou could| just hu|
|00000680| 6e 74 20 64 6f 77 6e 20 | 74 68 65 20 6c 65 66 74 |nt down |the left|
|00000690| 20 70 6f 69 6e 74 65 72 | 73 20 0a 6f 66 20 74 68 | pointer|s .of th|
|000006a0| 65 20 72 69 67 68 74 20 | 73 75 62 74 72 65 65 20 |e right |subtree |
|000006b0| 61 6e 64 20 68 6f 6f 6b | 20 74 68 65 20 6c 65 66 |and hook| the lef|
|000006c0| 74 20 73 75 62 74 72 65 | 65 20 6f 6e 20 77 68 65 |t subtre|e on whe|
|000006d0| 6e 20 79 6f 75 20 66 69 | 6e 64 20 61 20 4e 55 4c |n you fi|nd a NUL|
|000006e0| 4c 2e 20 0a 4f 72 20 74 | 68 65 20 73 79 6d 65 74 |L. .Or t|he symet|
|000006f0| 72 69 63 61 6c 20 73 6f | 6c 75 74 69 6f 6e 20 77 |rical so|lution w|
|00000700| 6f 75 6c 64 20 61 70 70 | 6c 79 20 6f 6e 20 74 68 |ould app|ly on th|
|00000710| 65 20 6f 74 68 65 72 20 | 73 69 64 65 2e 0a 0a 49 |e other |side...I|
|00000720| 6e 20 74 68 65 20 65 61 | 72 6c 79 20 73 65 76 65 |n the ea|rly seve|
|00000730| 6e 74 69 65 73 2c 20 74 | 68 65 72 65 20 77 65 72 |nties, t|here wer|
|00000740| 65 20 73 6f 6d 65 20 61 | 72 74 69 63 6c 65 73 20 |e some a|rticles |
|00000750| 69 6e 20 65 69 74 68 65 | 72 20 43 41 43 4d 20 6f |in eithe|r CACM o|
|00000760| 72 20 0a 43 6f 6d 70 75 | 74 69 6e 67 20 53 75 72 |r .Compu|ting Sur|
|00000770| 76 65 79 73 20 6f 6e 20 | 62 69 6e 61 72 79 20 74 |veys on |binary t|
|00000780| 72 65 65 73 2e 20 59 6f | 75 20 63 6f 75 6c 64 20 |rees. Yo|u could |
|00000790| 70 72 6f 62 61 62 6c 79 | 20 66 69 6e 64 20 74 68 |probably| find th|
|000007a0| 65 6d 20 69 6e 20 61 20 | 0a 6c 69 62 72 61 72 79 |em in a |.library|
|000007b0| 2e 0a 0a 49 20 77 72 6f | 74 65 20 61 20 62 61 6c |...I wro|te a bal|
|000007c0| 61 6e 63 65 72 20 66 6f | 72 20 74 68 65 73 65 20 |ancer fo|r these |
|000007d0| 61 20 6c 6f 6e 67 20 74 | 69 6d 65 20 61 67 6f 2e |a long t|ime ago.|
|000007e0| 20 49 74 20 73 74 61 72 | 74 65 64 20 61 74 20 74 | It star|ted at t|
|000007f0| 68 65 20 74 6f 70 20 6f | 66 20 61 20 0a 74 72 65 |he top o|f a .tre|
|00000800| 65 20 61 6e 64 20 6d 6f | 76 65 64 20 6e 6f 64 65 |e and mo|ved node|
|00000810| 73 20 66 72 6f 6d 20 6f | 6e 65 20 73 75 62 74 72 |s from o|ne subtr|
|00000820| 65 65 20 74 6f 20 74 68 | 65 20 6f 74 68 65 72 20 |ee to th|e other |
|00000830| 75 6e 74 69 6c 20 74 68 | 65 72 65 20 77 65 72 65 |until th|ere were|
|00000840| 20 63 6c 6f 73 65 20 0a | 74 6f 20 74 68 65 20 73 | close .|to the s|
|00000850| 61 6d 65 20 6e 75 6d 62 | 65 72 20 69 6e 20 65 61 |ame numb|er in ea|
|00000860| 63 68 2e 20 54 68 65 6e | 20 69 74 20 72 65 63 75 |ch. Then| it recu|
|00000870| 72 73 65 64 20 6f 6e 20 | 65 61 63 68 20 73 75 62 |rsed on |each sub|
|00000880| 74 72 65 65 20 74 6f 20 | 62 61 6c 61 6e 63 65 20 |tree to |balance |
|00000890| 0a 74 68 65 6d 2e 20 41 | 20 73 69 6d 69 6c 61 72 |.them. A| similar|
|000008a0| 20 6d 65 74 68 6f 64 20 | 77 6f 72 6b 73 20 66 6f | method |works fo|
|000008b0| 72 20 22 73 6f 72 74 61 | 22 20 62 61 6c 61 6e 63 |r "sorta|" balanc|
|000008c0| 69 6e 67 20 74 68 65 20 | 73 75 62 74 72 65 65 73 |ing the |subtrees|
|000008d0| 20 77 68 65 72 65 20 79 | 6f 75 20 0a 6d 61 6b 65 | where y|ou .make|
|000008e0| 20 73 75 72 65 20 74 68 | 65 79 20 61 72 65 6e 27 | sure th|ey aren'|
|000008f0| 74 20 74 6f 6f 20 6d 75 | 63 68 20 6f 75 74 20 6f |t too mu|ch out o|
|00000900| 66 20 62 61 6c 61 6e 63 | 65 20 62 75 74 20 6e 65 |f balanc|e but ne|
|00000910| 69 74 68 65 72 20 64 6f | 20 79 6f 75 20 63 61 72 |ither do| you car|
|00000920| 65 20 74 68 65 20 0a 62 | 61 6c 61 6e 63 69 6e 67 |e the .b|alancing|
|00000930| 20 70 72 69 63 69 70 6c | 65 20 74 6f 20 65 78 63 | pricipl|e to exc|
|00000940| 65 73 73 2e 0a 0a 2d 2d | 20 4c 65 65 20 4d 65 61 |ess...--| Lee Mea|
|00000950| 64 6f 72 0a | |dor. | |
+--------+-------------------------+-------------------------+--------+--------+